home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / gus / mikmod2.zip / MODLOAD.H < prev    next >
C/C++ Source or Header  |  1993-11-28  |  2KB  |  62 lines

  1. #ifndef MODLOAD_H
  2. #define MODLOAD_H
  3.  
  4. #include <stdio.h>
  5. #include "mytypes.h"
  6.  
  7.  
  8. #define MAX_PATTERNS    128
  9. #define MAX_SAMPLES        31
  10.  
  11.  
  12. typedef struct MSAMPINFO{    // sample header as it appears in a module
  13.     UBYTE samplename[22];
  14.     UWORD length;
  15.     UBYTE finetune;
  16.     UBYTE volume;
  17.     UWORD reppos;
  18.     UWORD replen;
  19. } MSAMPINFO;
  20.  
  21.  
  22. typedef struct SAMPLEINFO{    // new sample info with some converted types
  23.     char  samplename[23];
  24.     UBYTE finetune;
  25.     UBYTE volume;
  26.     ULONG length;
  27.     ULONG reppos;
  28.     ULONG replen;
  29. } SAMPLEINFO;
  30.  
  31.  
  32.  
  33. typedef struct MODULEHEADER{
  34.     UBYTE      songname[20];            // the songname..
  35.     MSAMPINFO  samples[31];                // all sampleinfo
  36.     UBYTE      songlength;                // number of patterns used
  37.     UBYTE      magic1;                    // should be 127
  38.     UBYTE      positions[128];            // which pattern to play at pos
  39.     UBYTE      magic2[4];                // string "M.K." or "FLT4" or "FLT8"
  40. } MODULEHEADER;
  41.  
  42.  
  43. int      ML_LoadModule(char *filename,FILE *ufp);
  44. void  ML_RegisterSampleLoader(int (*Loader)(int samplenr,FILE *fp,ULONG size));
  45.  
  46.  
  47. extern int ml_errno;                // last error number
  48. extern char *ml_errlist[];            // list of error strings
  49. extern int ml_numchn;                // number of channels in use
  50. extern int ml_numpat;                // number of patterns used
  51. extern int ml_numsmp;                // number of samples used
  52. extern int ml_patsiz;                // size (bytecount) per pattern
  53. extern char *ml_modtype;            // module type name
  54. extern void far *ml_patlist[128];    // a list of all patterns
  55. extern char ml_songname[21];        // 0-term songname string
  56. extern UBYTE ml_songlength;            // songlength
  57. extern UBYTE ml_positions[128];        // song sequence
  58. extern SAMPLEINFO ml_samples[31];    // sample info
  59.  
  60.  
  61. #endif
  62.